//2009/08/09 16:41:34
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>

using namespace std;

class RPG
{
public:
    vector<int> dieRolls(vector <string> dice)
    {
		int total = 0;
		int Min = 0;
		int Max = 0;
		for(int i=0; i<dice.size(); i++)
		{
			stringstream s(dice[i]);
			int a,b;
			char c;
			s >> a >> c >> b;
			Min += a;
			Max += b * a;
			total += a * (1 + b);
		}
		int score = total / 2;
		
		vector<int> ret;
		ret.push_back(Min);
		ret.push_back(Max);
		ret.push_back(score);
		
		return ret;
    }
};
